package cn.xdf.docscan.ui

import cn.xdf.docscan.view.QuadrilateralView

class QuadrilateralViewAdapter(private val view: QuadrilateralView) : QuadOverlay {
    override fun updateDetection(detections: List<QuadOverlay.Detection>) {
        val mapped = detections.map {
            QuadrilateralView.Detection(it.corners, it.confidence)
        }
        view.updateDetection(mapped)
    }

    override fun clearDetection() {
        view.clearDetection()
    }

    override val width: Int get() = view.width
    override val height: Int get() = view.height
}



